function debounce(fn, wait=300) {
    var timeout = null;
    return function () {
      if (timeout !== null) clearTimeout(timeout);
      timeout = setTimeout(fn, wait);
    };
}
let fn=()=>{
    console.log("fn");
}
let fx=debounce(fn);

fx();
fx();




console.log("....");